package com.ids.actions;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.ids.bean.ForgotPassword;
import com.ids.service.LoginService;
import com.ids.util.Utlity;
import com.opensymphony.xwork2.ActionSupport;


public class ForgetPassword extends ActionSupport {


	private static final long serialVersionUID = 1L;
	private String emailempId;

	public String execute() throws Exception {

		HttpServletRequest request = ServletActionContext.getRequest();
		String contextPath = request.getContextPath();
		int port = request.getLocalPort();
		String hostName = request.getLocalName();
		Utlity utlity = new Utlity();
		utlity.getInfo(contextPath, port, hostName);
		LoginService loginService = new LoginService();
		ForgotPassword fp = loginService.forgotPassword(emailempId);
		Utlity.sendMail(fp);
		return SUCCESS;
	}

	public String getEmailempId() {
		return emailempId;
	}

	public void setEmailempId(String emailempId) {
		this.emailempId = emailempId;
	}

}
